<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/6/11
  Time: 16:07
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>用户列表</title>

    <style type="text/css">
        a {
            text-decoration: none
        }

    </style>

</head>

<body>

    <table border="1" width="100%" style="text-align: center;">

        <caption> <h1>用户列表</h1> </caption>

        <tr>
            <td> 索引编号 </td>
            <td> 用户编号 </td>
            <td> 用户名称 </td>
            <td> 用户密码 </td>
            <td> 用户邮箱 </td>
            <td> 用户电话 </td>
            <td> 用户状态 </td>
            <td> 用户编辑 </td>
        </tr>

        <c:forEach items="${requestScope.userPage.currentList}" var="user" varStatus="statusObject">
            <tr>
                <td> ${statusObject.count} </td>
                <td> ${user.u_id} </td>
                <td> ${user.u_name} </td>
                <td> ${user.u_password} </td>
                <td> ${user.u_email} </td>
                <td> ${user.u_phone} </td>
                <td> ${user.u_status == 1 ? "已授权":"禁用"} </td>

                <td>
                    <strong>

                        <a href="?act=toEditUser&id=${user.u_id}"> 修改 </a> |

                        <a href="?act=toDeleteUser&id=${user.u_id}"> 删除 </a> |

                    </strong>
                </td>
            </tr>
        </c:forEach>

        <tr>
            <td colspan="8">
                <strong>
                    <a href="?act=userList"> 首页 </a> |
                    <a href="?act=userList&page=${requestScope.userPage.pageIndex-1}"> 上一页 </a> |
                    <a href="?act=userList&page=${requestScope.userPage.pageIndex+1}"> 下一页 </a> |
                    <a href="?act=userList&page=${requestScope.userPage.totalPages}">末页</a>
                    [ 当前第 ${requestScope.userPage.pageIndex} 页，一共 ${requestScope.userPage.totals} 记录 ] |
                    <a href="?act=toAddUser"> 添加用户 </a> |
                    <a href="user?act=toUserRoleAssociate"> 角色权限设置 </a> |

                    <form action="user" method="post" style="display: inline">
                        <input type="text" name="act" value="toSearchUsers" hidden>
                        <input type="text" name="keywords" >
                        <input type="submit" value="搜索" >
                    </form>
                </strong>
            </td>
        </tr>

    </table>
</body>
</html>
